package ProjectXXX;

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.border.TitledBorder;
import java.util.Vector;


public class PrintReportPanelVersion3 extends JPanel
{
	//attributes
	private JPanel basePanel = null,southBasePanel = null,centerBasePanel = null,
	               reportChoosePanel = null,reportPanel = null,
	               customPanel = null; 
	               
	private JButton displayBut = null,printBut = null;
              
    private JLabel reportPanelLabel = null;           
               
	private JLabel pageLabel = null,custTestLabel = null,customLabel = null;
	                             
	
	private JTextArea reportJTA = null;
	
	private JTextField toDateJTF = null,fromDateJTF = null;
	private JPanel jtfPanel = null;
	private JButton toDateBut = null,fromDateBut = null;
	private Vector reportVect = null;
	
	
	private JScrollPane jsp = null;
	
	private JComboBox jcb1 = null;
	private JPanel jcbPanel = null;
	
	private JLabel jcbLabel1 = null,jcbLabel2 = null,jcbLabel3 = null;
	
	private JFrame testFrame;
	
	//colours & FOnts
	private Font butFont;
	private Font mainLabelFont;
	private Color customColour;
	
	//constructor
	public PrintReportPanelVersion3()
	{
	    //colours & fonts
	    butFont = new Font("ButtonFont",Font.BOLD,15);
		mainLabelFont = new Font("MainFont",Font.BOLD,40);
		customColour = Color.blue;
		Dimension dim = new Dimension(400,70);
		
		//+++customPane
		customLabel = new JLabel("SELECT REPORT");
		customPanel = new JPanel();
		BoxLayout b1 = new BoxLayout(customPanel,BoxLayout.Y_AXIS);
		customPanel.setLayout(b1);
        jcbPanel = new JPanel();
        reportVect = new Vector();
        reportVect.addElement("<SELECT REPORT>");
        reportVect.addElement("TOTAL SALES");
        reportVect.addElement("TOTAL RENTALS");
        reportVect.addElement("TOP 10 RESOURCES");
        reportVect.addElement("TOP 10 CUSTOMERS");
        reportVect.addElement("Old Stock");
		jcbLabel1 = new JLabel("Dated summary");
		jcb1 = new JComboBox(reportVect);
		jcb1.setPreferredSize(dim);
		jcbPanel.add(jcb1);
		jtfPanel = new JPanel(new GridLayout(0,2));
		toDateBut = new JButton("FROM DATE");
		fromDateBut = new JButton("TO DATE");
		toDateJTF = new JTextField("To Date",20);
		fromDateJTF = new JTextField("From Date",20);
		jtfPanel.add(toDateJTF);
		jtfPanel.add(toDateBut);
		jtfPanel.add(fromDateJTF);
		jtfPanel.add(fromDateBut);
		JLabel infoLabel = new JLabel("SELECT DATE/s");
		
		customPanel.add(jcbPanel);
		customPanel.add(jtfPanel);
		customPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createLineBorder(Color.blue,1),"SELECT REPORT"));
		
		reportChoosePanel = new JPanel(new GridLayout(1,1));

		reportChoosePanel.add(customPanel);
		
		reportJTA = new JTextArea();
		reportJTA.setRows(20);
		reportJTA.setColumns(20);
		jsp = new JScrollPane(reportJTA,ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
		reportPanelLabel = new JLabel("Report :");
		reportJTA.setEditable(false);
		reportPanel = new JPanel(new GridLayout(1,1));
		reportPanel.setBorder(BorderFactory.createEmptyBorder(30,30,20,0));
		//reportPanel.add(reportPanelLabel);
		reportPanel.add(jsp);
		//reportPanel.setBorder(BorderFactory.createEtchedBorder(Color.blue,Color.black));
		centerBasePanel = new JPanel(new BorderLayout());
		centerBasePanel.add(reportPanel,BorderLayout.CENTER);
		centerBasePanel.add(reportChoosePanel,BorderLayout.WEST);
	
		//***************************************************************
		
		//southBasePanel
		printBut = new JButton("PRINT");
		printBut.setBorder(BorderFactory.createRaisedBevelBorder());
		printBut.setFont(butFont);
		printBut.setForeground(customColour);
		displayBut = new JButton("DISPLAY");
		displayBut.setBorder(BorderFactory.createRaisedBevelBorder());
		displayBut.setFont(butFont);
		displayBut.setForeground(customColour);
		
		southBasePanel = new JPanel();
		southBasePanel.add(displayBut);
		southBasePanel.add(printBut);
		
	    //main Base Panel
		basePanel = new JPanel(new BorderLayout());
		//basePanel.add(pageLabel,BorderLayout.NORTH);
		basePanel.add(centerBasePanel);
		basePanel.add(southBasePanel,BorderLayout.SOUTH);
		basePanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(Color.white,Color.blue),"REPORT PAGE"));
		                    
		
		//setup This panel
		this.setLayout(new GridLayout(1,1));
		this.add(basePanel);
		
		//testFrame
		testFrame = new JFrame();
		testFrame.getContentPane();
		testFrame.add(this);
		testFrame.setSize(800,600);
		testFrame.setVisible(true);
		
		
	}//end constructor
	
	
	public static void main(String [ ] args)
	{
		new PrintReportPanelVersion3();
	}
	
}//end PrintReportPanel